package top.z.work.module.system.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.z.work.module.system.api.logger.dto.SystemLoggerErrorDto;
import top.z.work.module.system.entity.SystemLoggerError;
import top.z.work.module.system.mapper.SystemLoggerErrorMapper;
import top.z.work.module.system.service.SystemLoggerErrorService;

/**
 * SystemLoggerError ServiceImpl
 *
 * @author zaoangod
 * @since 2024-03-22
 */
@Service
public class SystemLoggerErrorServiceImpl extends ServiceImpl<SystemLoggerErrorMapper, SystemLoggerError> implements SystemLoggerErrorService {

    /**
     * 创建API错误日志
     *
     * @param data 数据
     */
    @Override
    public void createLoggerError(SystemLoggerErrorDto data) {
        SystemLoggerError systemLoggerError = BeanUtil.toBean(data, SystemLoggerError.class);
        this.save(systemLoggerError);
    }
}
